<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
    $("#<?php echo $id;?>").DataSource({url:'payset/get_online_pay_setting',
        fields:[[
            {field:'platform',      title:'平台', align:'center', width:100,sortable:true},
            {field:'business_id',title:'商户ID', align:'center', width:200, sortable:false},
            {field:'day_pay_limit',title:'当日支付限额',align:'center', width:200, sortable:true},
            {field:'status',title:'状态', align:'center',  width:150,  sortable:true, formatter:function(v, r){
                return r.status ? '启用' : '停用';
            }},
            {field:'op',      title:'操作', align:'center', width:330,sortable:false,formatter:function(v,r){
                var str = '<a herf="#" class="btn btn-danger btn-xs" onclick=Core.dialog(\'修改支付信息\',\'payset/edit_pay_info\',function(){},true,false);>修改</a>&nbsp;'+
                    '<a herf="#" class="btn btn-danger btn-xs" onclick="Core.addTab(\'存款记录\', \'payset/online_pay_list/id/'+r.id+'\')">存款记录</a>&nbsp;';

                if (r.status) {
                        var post_data = "{id:'<?php echo $id?>', edit_status:'stop'}";
//                        console.log(obj);
                        str += '<a herf="javascript:void(0);" class="btn btn-danger btn-xs" onclick="Core.confirm(\'<?php echo $id;?>\',' + post_data + ', \'payset/edit_online_pay_setting\', \'确定要停用所选记录吗？ \')">停用</a>&nbsp;';
                }
                var post_data = "{id:'<?php echo $id?>'}";
                str += '<a herf="javascript:void(0);" class="btn btn-danger btn-xs" onclick="Core.confirm(\'<?php echo $id?>\',' + post_data + ', \'payset/del_online_pay_setting\', \'确定要删除所选记录吗？ \')">删除</a>&nbsp;';

                return str;
            }}
        ]], tools:[
            {instant:false},
            <?php if(in_array('ADD',$auth)){?>
                {text:"新增线上支付",iconCls:"icon-add",handler:function(){
                    $('#<?php echo $id?>').DataSource('add',{title:'新增线上支付',get:'payset/edit_pay_info',full:false});
                }},
            <?php }?>
            {text:"线上支付存款记录",iconCls:"icon-payment",handler:function(){
                Core.addTab('线上支付存款记录', 'payset/online_pay_list');
            }},
            '|',
                {type:'combobox',text:'状态',width:100,name:'status',value:'', items:'<option value="">启用</option><option value="1">停用</option>'},
                {type:'combobox',text:'第三方平台',width:100,name:'platform',value:'', items:'<option value="">OK付</option><option value="1">讯汇宝</option>'},
                {text:"搜索", iconCls:"icon-search", handler:function(){
                    $('#<?php echo $id?>').DataSource('search');
                }},
            '-'
        ],
        footer:true,
        checkbox:false,
        success:function(){

        }
    });
</script>